package com.qf.limit.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.qf.limit.entity.User;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;

/**
 * (User)表服务接口
 *
 * @author makejava
 * @since 2024-09-10 09:34:37
 */
public interface UserService extends IService<User> {
    User queryUserName(String userName);


    //
    public boolean changePassword(String userId, String oldPassword, String newPassword) {
        User user = findUserById(userId);
        if (user != null && user.getPassword().equals(oldPassword)) {
            user.setPassword(hashPassword(newPassword));
            updateUser(user);
            return true;
        }
        return false;
    }

    private User findUserById(String userId) {
    }

    private void updateUser(User user) {
    }

    private String hashPassword(String password) {
    }
}
